﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Core.Extensions;

namespace MvcEngine.Core.Exceptions
{
    public class LocalizationException : Exception
    {
        private string message;

        public string Key { get; set; }
        public string[] SearchedLocations { get; set; }

        public LocalizationException(string message)
        {
            this.message = message;
        }

        public LocalizationException(string key, string[] searchedLocations)
        {
            this.Key = key;
            this.SearchedLocations = searchedLocations;
        }

        public override string Message
        {
            get
            {
                return string.Format("Key {0} was not found in the localization file. Locations searched: {1}", Key, SearchedLocations.ConvertToString());
            }
        }
    }
}
